// import 'package:flutter/material.dart';
// import 'package:flutter_grid_button/flutter_grid_button.dart';
// import 'package:ichinesereader/constants.dart';
// import 'package:ichinesereader/utils/helper.dart';

// class LevelGridButtons extends StatefulWidget {
//   @override
//   State<LevelGridButtons> createState() => _LevelGridButtonsState();
// }

// class _LevelGridButtonsState extends State<LevelGridButtons> {
//   @override
//   Widget build(BuildContext context) {
//     const textStyle = TextStyle(fontSize: 26);
//     return Builder(builder: (context) {
//       return Padding(
//         padding: const EdgeInsets.all(2.0),
//         child: GridButton(
//           textStyle: textStyle,
//           borderColor: Colors.grey[300],
//           borderWidth: 2,
//           onPressed: (dynamic val) {},
//           items: [
//             Constants.bookLevelColors
//                 .where((element) => element.level != 0)
//                 .map((booklevel) => GridButtonItem(
//                     title: booklevel.level.toString(),
//                     color: hexStringToHexInt(booklevel.color.toString()),
//                     flex: 1,
//                     child: TextButton(
//                         onPressed: () {},
//                         child: Text(booklevel.level.toString()))))
//                 .toList(),
//             Constants.levelAxisCategories
//                 .where((element) => element.level == 0)
//                 .map((booklevel) => GridButtonItem(
//                     title: booklevel.level.toString(),
//                     color: Constants.bookLevelColors
//                         .where(
//                             (element) => element.actflLevel == booklevel.text)
//                         .first
//                         .actflColor,
//                     flex: int.parse(booklevel.end.toString()) -
//                         int.parse(booklevel.start.toString()) +
//                         1,
//                     child: TextButton(
//                         onPressed: () {},
//                         child: Text(booklevel.text.toString()))))
//                 .toList(),
//           ],
//         ),
//       );
//     });
//   }
// }
